package io;

import java.io.*;

public class CopyDemo3 {
    public static void main(String[] args) throws IOException {
        FileInputStream fis = new FileInputStream("xg.jpg");//文件输入流---低级流
        BufferedInputStream bis = new BufferedInputStream(fis);//缓冲输入流------高级流
        FileOutputStream fos = new FileOutputStream("xg3.jpg");//文件输出流-低级流
        BufferedOutputStream bos = new BufferedOutputStream(fos);//缓冲输出流----高级流

        long start = System.currentTimeMillis();
        int d;
        while((d=bis.read())!=-1){
            bos.write(d);
        }

        long end = System.currentTimeMillis();
        System.out.println("复制完毕，耗时"+(end-start)+"ms");
        bis.close();
        bos.close();
    }
}
